import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/work_tool_entity.dart';
import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';


WorkToolEntity $WorkToolEntityFromJson(Map<String, dynamic> json) {
  final WorkToolEntity workToolEntity = WorkToolEntity();
  final int? bindStatus = jsonConvert.convert<int>(json['bindStatus']);
  if (bindStatus != null) {
    workToolEntity.bindStatus = bindStatus;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    workToolEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    workToolEntity.createBy = createBy;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    workToolEntity.createDate = createDate;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    workToolEntity.id = id;
  }
  final List<String>? ids = (json['ids'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (ids != null) {
    workToolEntity.ids = ids;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    workToolEntity.updateBy = updateBy;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    workToolEntity.updateDate = updateDate;
  }
  final String? workTool = jsonConvert.convert<String>(json['workTool']);
  if (workTool != null) {
    workToolEntity.workTool = workTool;
  }
  final String? workTypeId = jsonConvert.convert<String>(json['workTypeId']);
  if (workTypeId != null) {
    workToolEntity.workTypeId = workTypeId;
  }
  final String? workTypeName = jsonConvert.convert<String>(json['workTypeName']);
  if (workTypeName != null) {
    workToolEntity.workTypeName = workTypeName;
  }
  final bool? isChecked = jsonConvert.convert<bool>(json['isChecked']);
  if (isChecked != null) {
    workToolEntity.isChecked = isChecked;
  }
  return workToolEntity;
}

Map<String, dynamic> $WorkToolEntityToJson(WorkToolEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['bindStatus'] = entity.bindStatus;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createDate'] = entity.createDate;
  data['id'] = entity.id;
  data['ids'] = entity.ids;
  data['updateBy'] = entity.updateBy;
  data['updateDate'] = entity.updateDate;
  data['workTool'] = entity.workTool;
  data['workTypeId'] = entity.workTypeId;
  data['workTypeName'] = entity.workTypeName;
  data['isChecked'] = entity.isChecked;
  return data;
}

extension WorkToolEntityExtension on WorkToolEntity {
  WorkToolEntity copyWith({
    int? bindStatus,
    String? companyCode,
    String? createBy,
    String? createDate,
    String? id,
    List<String>? ids,
    String? updateBy,
    String? updateDate,
    String? workTool,
    String? workTypeId,
    String? workTypeName,
    bool? isChecked,
  }) {
    return WorkToolEntity()
      ..bindStatus = bindStatus ?? this.bindStatus
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..ids = ids ?? this.ids
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate
      ..workTool = workTool ?? this.workTool
      ..workTypeId = workTypeId ?? this.workTypeId
      ..workTypeName = workTypeName ?? this.workTypeName
      ..isChecked = isChecked ?? this.isChecked;
  }
}
